package org.csu.mypetstore.persistence;

import org.apache.ibatis.annotations.Param;
import org.csu.mypetstore.domain.Account;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface AccountMapper {

    Account getAccountByUsername(String username);

    Account getAccountByUsernameAndPassword(@Param("username") String username, @Param("password") String password);

    List<Account> getAccountList();

    void addAccount(Account account);

    void addSignon(Account account);

    void updateSignon(@Param("username") String username, @Param("password") String password);

    void updateAccount(Account account);

    void deleteAccount(String username);

    void deleteSignon(String username);

    String checkUsernameExists(String username);

    boolean isAdmin(String username);

}
